nth root algorithm

From HandWiki

The principal nth root An of a positive real number A, is the positive real solution of the equation xn=A. For a positive integer n there are n distinct complex solutions to this equation if A>0, but only one is positive and real.

Using Newton's method

Newton's method is a method for finding a zero of a function f(x). The general iteration scheme is:

  1. Make an initial guess x0
  2. Set xk+1=xkf(xk)f(xk)
  3. Repeat step 2 until the desired precision is reached.

The nth root problem can be viewed as searching for a zero of the function

f(x)=xnA

So the derivative is

f(x)=nxn1

and the iteration rule is

xk+1=xkf(xk)f(xk)
=xkxknAnxkn1
=xk+1n[xk+Axkn1]
=1n[(n1)xk+Axkn1].

See also

References

  • Atkinson, Kendall E. (1989), An introduction to numerical analysis (2nd ed.), New York: Wiley, ISBN 0-471-62489-6 .